home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C
/
Frameworks
/
Extension Shell 1.5
/
Sample Extensions (1.5)
/
Bell Test ƒ
/
BT AddrsTable.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-11-01
|
2KB
|
102 lines
/* NAME:
BT AddrsTable.c
WRITTEN BY:
Dair Grant
DESCRIPTION:
This file contains a a code resource that acts as a Gestalt Selector
function to be installed as an address table. When called, it will
return the address of its internal address table.
___________________________________________________________________________
*/
//=============================================================================
// Include files
//-----------------------------------------------------------------------------
#include "A4Stuff.h"
#include "SetupA4.h"
#include "BT AddrsTable.h"
//=============================================================================
// Function prototypes
//-----------------------------------------------------------------------------
pascal OSErr main(OSType theSelector, long *theResponse);
//=============================================================================
// Global variables
//-----------------------------------------------------------------------------
BTAddressTable gTheAddressTable;
//=============================================================================
// main : Entry point to our Gestalt Selector function.
//-----------------------------------------------------------------------------
// Note : When called, we return the address of our address table
// structure.
//-----------------------------------------------------------------------------
pascal OSErr main(OSType theSelector, long *theResponse)
{ long oldA4;
// Set up A4 to access our globals
#ifndef powerc
oldA4 = SetCurrentA4();
#endif
// Return the address of gTheAddressTable. We treat theResponse as a pointer
// to a variable that's a pointer to an address table, and write to it
// accordingly.
*theResponse = (long) &gTheAddressTable;
// Restore A4 and return
#ifndef powerc
SetA4(oldA4);
#endif
return(noErr);
}